import java.util.Scanner;

public class L2 {
    public static void main(String[] args){
        System.out.println("*********************************");
        System.out.println("*****微型计算器              ****");
        System.out.println("*****1、求和                 ****");
        System.out.println("*****2、求差                 ****");
        System.out.println("*****3、求积                 ****");
        System.out.println("*****4、求商                 ****");
        System.out.println("*****5、求余                 ****");
        System.out.println("*****Q、退出                 ****");
        System.out.println("*****请选择您想执行的操作    ****");
        System.out.println("*********************************");
        System.out.println("请选择一项");
        Scanner reader = new Scanner(System.in);
        String num = reader.next();
        if (num.equals("Q")){
            System.out.println("退出程序");
        }
        else {
            System.out.println("请输入两个数");
            double a = reader.nextDouble();
            double b = reader.nextDouble();
            switch (num){
                case "1" :
                    System.out.printf("%.2f",a+b);
                    break;
                case "2" :
                    System.out.printf("%.2f",a-b);
                    break;
                case "3" :
                    System.out.printf("%.2f",a*b);
                    break;
                case "4" :
                    System.out.printf("%.2f",a/b);
                    break;
                case "5" :
                    System.out.printf("%.2F",a%b);
                    break;
            }
        }
    }
}

